package com.esgpro.esg_api.util;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;


@Component
public class StringUtil {
    public static List<String> StringFormat(String str) {
        List<String> list = new ArrayList<>();
        String[] strs = str.split("&");
        if (strs.length > 1) {
            for (String s : strs) {
                String[] split = s.split("=");
                if (split.length > 1) {
                    System.out.println(1);
                    list.add(split[1]);
                }
            }
        } else if (strs.length == 1){
            String[] split = str.split("=");
            if (split.length > 1) {
                System.out.println(1);
                list.add(split[1]);
            }
        }

        else list.add("");
        return list;
    }
}
